﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WorkTime_workoutwance : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.DLMonth.SelectedValue = (DateTime.Now.Month - 1).ToString();
            this.GridViewBind();

            MasterPage_MasterPage mpg = (MasterPage_MasterPage)this.Page.Master;
            mpg.HelpHref = "";
            mpg.PageName = "公出午饭补贴统计";
            mpg.PicUrl = "";
            mpg.IntiBar();
        }
    }
    protected void Refresh_Click(object sender, EventArgs e)
    {
        this.GridViewBind();
    }

    private void GridViewBind()
    {
        string where = "1=1";
        string year = this.DlYear.SelectedValue;
        string month = this.DLMonth.SelectedValue;
        string depId = this.DepartmentDList1.SelectDepmanetId;
        if (depId.Length > 0 && depId != "0")
            where += " AND department.departmentid='" + depId + "'";
        where += " AND year(worktime_out.CurrDate)='" + year + "'";
        where += " AND month(worktime_out.CurrDate)='" + month + "'";
        this.WebDataSource1.SetWhere(where);
        this.GridView1.DataBind();
    }
}
